#pragma once

#include <folly/ProducerConsumerQueue.h>
#include <folly/fibers/Baton.h>

namespace nexus {

template <class T>
class BlockingQueue : public folly::ProducerConsumerQueue<T> {
 public:
  BlockingQueue<T>(uint32_t size) : folly::ProducerConsumerQueue<T>(size){};
  // ~BlockingQueue();

  void read(T& data);
  void write(T&& data);

 private:
  folly::fibers::Baton baton_;
};

} // namespace nexus

#include "BlockingQueueImpl.h"